// helper class, allowing min & max functions to return value and column in the same time
// it was useful during the tests
//
public class Pair {
	private static final int maxVal = 100000000;
	public int column = 3;
	public int value = maxVal;

	public Pair(int column, int value) {
		this.column = column;
		this.value = value;
	}

	public Pair(String type) {
		if (type == "max") {
			column = -1;
			value = maxVal;
		} else if (type == "min") {
			column = -1;
			value = -maxVal;
		}
	}

	public Pair(int value) {
		this.value = value;
	}

	public Boolean lower(Pair compareTo) {
		return value < compareTo.value;
	}

	public Boolean equal(Pair compareTo) {
		return value == compareTo.value;
	}

	public Boolean equal(int compareTo) {
		return value == compareTo;
	}

	public Boolean equal(String type) {
		return (type == "max" && value == maxVal)
				|| (type == "min" && value == -maxVal);
	}

	public boolean greater(Pair compareTo) {
		return value > compareTo.value;
	}

	public void set(Pair compareTo) {
		this.value = compareTo.value;
		this.column = compareTo.column > -1 ? compareTo.column : this.column;
	}

	public void set(int column, int value) {
		this.column = column;
		this.value = value;
	}
}
 